import { JSEncrypt } from "jsencrypt";
export const RsaMixin = {
  encryptedData(publicKey, data) {
    // 新建JSEncrypt对象
    const encryptor = new JSEncrypt();
    // 设置公钥
    encryptor.setPublicKey(publicKey);
    // 加密数据
    return encryptor.encrypt(data);
  }
};
